-
Notifications
You must be signed in to change notification settings - Fork 511
Add Intl.Segmenter support #539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
// 2. "Mei (梅) has (有) many (很多) sons (儿子)" | ||
// We want to see that diffWords will get the word counts right and won't try to treat the | ||
// trailing 子 as common to both texts (since it's part of a different word each time). | ||
// TODO: Check with a Chinese speaker that this example is correct Chinese. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, @ExplodingCabbage, I'm Chinese, I can confirm that the meaning of these two sentences are correct.
But I'm not sure about the test purpose here.
I can see that
> [...chineseSegmenter.segment('我有很多桌子。')].map(({segment})=>segment)
[ '我有', '很多', '桌子', '。' ]
> [...chineseSegmenter.segment('梅有很多儿子。')].map(({segment})=>segment)
[ '梅', '有', '很多', '儿子', '。' ]
Not sure why '我有' are together, but '梅', '有' are separated, if you want test something similar you can change 梅有
to 他有
(He has) or 她有
(She has).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite strange...
> [...chineseSegmenter.segment('她有很多桌子。')].map(({segment})=>segment)
[ '她', '有', '很多', '桌子', '。' ]
> [...chineseSegmenter.segment('他有很多桌子。')].map(({segment})=>segment)
[ '他有', '很多', '桌子', '。' ]
'她' and '他' are the same, but one for male, one for female.
Resolves #438; probably also adequately resolves #214 even though it's not quite the solution that was asked for in that issue.